<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div >
<div class="list_DH">
        <%--  --%>
       <%@include file="/WEB-INF/templates/common/medShelve.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0" >病案上架</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table" style="position: relative; z-index: 999;">
                <ul class="clearfix" style="margin-bottom:0;">
				    <li class="Label_1">病案号：&nbsp;</li>
				    <li class="Label_2" ><input class="input_box" type="text"   name='name' id='name' value='1-10523093' /></li>
					<li class="Label_1">识别码：&nbsp;</li>
				    <li class="Label_2"><input class="input_box"  type="text"  name='' id='idCard' value='1002059' /></li>
				    <li class="Label_1">姓名：&nbsp;</li>
				    <li class="Label_2" ><input class="input_box" type="text"   name='' id='idCard' value='孙桂荣' /></li>
                	<li class="Label_1" >记录日期：&nbsp;</li>
                    <li class="Label_2"><input class="input_box Wdate" type="text"  name='startTime' id='outHospitalStartDate' value='2017-05-26' onFocus="WdatePicker()" /></li>
                   <li class="Label_1">病案踪迹：&nbsp;</li>
				    <li class="Label_2"><select class="input_box" name="shizong.bnsz" id="yijizj">
					    <option value="1">1-病案科内示踪</option>
					    <option value="11">11-病案归档</option>
					    <option value="12">12-病案质控</option>
					    <option value="14">14-分类编目</option>
					    <option value="15">15-病案审核</option>
					    <option value="16">16-病案上架</option>
					    <option value="17">17-浏览病案</option>
					    <option value="18">18-打印病案</option>
					    <option value="19">19-自主查询</option>
					    <option value="2">2-临床科室调阅</option>
					    <option value="21">21-临床查询病案</option>
					    <option value="22">22-临床打印病案</option>
					    <option value="3">3-相关部门调阅病案</option>
					    <option value="31">31-相关部门查询病案</option>
					    <option value="32">32-相关部门打印病案</option>
					    <option value="4">4-病案文档处理</option>
					    <option value="41">41-病案扫描</option>
					    <option value="42">42-扫描核对</option>
					    <option value="43">43-文档审核</option>
					    <option value="44">44-文本编辑</option>
					    <option value="45">45-编制条码</option>
					    <option value="5">5-统计报表</option>
					    <option value="51">51-统计直报</option>
					    <option value="52">52-质量监测报表</option>
					    <option value="9">9-其他</option>
					</select></li>
					   
                    <li class="Label_5">
                        <div class="right" style="text-align:right">
                            <a onclick="searchQua()">保存</a>
                         
                        </div>
                    </li>  
                </ul>
        
             <table class="Search_tableList" border-collapse:collapse;" cellpadding="0" cellspacing="0">
                <tr>		
             		<td class="tdLabel_4">病案号</td>
                    <td class="tdLabel_4">识别码</td>
                    <td class="tdLabel_4">姓名</td>
                    <td class="tdLabel_4">记录日期</td>
                    <td class="tdLabel_4">病案踪迹</td>
                    <td class="tdLabel_4">操作者</td>
                </tr>
                
                <tbody id="tbody">
 
  
                 <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-26</td>
                    <td class="tdLabel_5">41-病案扫描</td>
                    <td class="tdLabel_5">曾庆婷</td>
                </tr>
                <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-26</td>
                    <td class="tdLabel_5">16-病案上架</td>
                    <td class="tdLabel_5">曾庆婷</td>
                </tr>
                <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-24</td>
                    <td class="tdLabel_5">15-病案审核</td>
                    <td class="tdLabel_5">孙巧珑</td>
                </tr>
                <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-24</td>
                    <td class="tdLabel_5">14-分类编目</td>
                    <td class="tdLabel_5">李玉玲</td>
                </tr>
                <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-24</td>
                    <td class="tdLabel_5">12-病案质控</td>
                    <td class="tdLabel_5">崔振</td>
                </tr>
                <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-22</td>
                    <td class="tdLabel_5">11-病案归档</td>
                    <td class="tdLabel_5">王莹</td>
                </tr>
               <tr>		
             		<td class="tdLabel_5">1-10523093</td>
                    <td class="tdLabel_5">1002059</td>
                    <td class="tdLabel_5">孙桂荣</td>
                    <td class="tdLabel_5">2017-05-17</td>
                    <td class="tdLabel_5">18-打印病案</td>
                    <td class="tdLabel_5">张文玺</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="pageList">
            <ul class="pagination clearfix" id="page_plus"></ul>
            <div class="pagination">
                <div>总共：<b id="totalPage">0</b> 条信息    当前页是第 <b id="currentPage">0/0</b>　页</div>
            </div>
        </div>
    </div>
</div>
</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">
	
	function searchQua(){
		window.location.href="";
		//queryQua(0,20);
	}

	function queryQua(currentStartNum,pageSize){
		
		var name=$("#name").val();
		var idCard=$("#idCard").val();
		var outHospitalStartDate=$("#outHospitalStartDate").val();
		var outHospitalEndDate=$("#outHospitalEndDate").val();
		
		if((outHospitalStartDate==null || outHospitalStartDate=="") && (outHospitalEndDate==null || outHospitalEndDate=='') && (name==null || name=='') && (idCard==null || idCard=='')){
			alert("请输入查询条件!");
			return;
		}
		

		
		
		jQuery.support.cors = true;
		$.ajax({
			type:"get",
			url:"http://localhost:8888/medical-manage/statis/queryMedrecordByAjax",
			data:{idCard:idCard,outHospitalStartDate:outHospitalStartDate,outHospitalEndDate:outHospitalEndDate,name:name,currentStartNum:currentStartNum,pageSize:pageSize},
			success:function(data){
				$("#tbody").html("");
				
				if(data.success){
					var hospitalizationNotes=data.data.hospitalizationNotes;
					var medRecordQuery=data.data.medRecordQuery;
				
					var totalCounts=medRecordQuery.totalCounts;
					var html="";
					for(var i=0;i<hospitalizationNotes.length;i++){
						var hospitalizationNote=hospitalizationNotes[i];
						html+=" <tr>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.mr_id+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.name+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.id_number+"</td>"+
				              "      <td class='tdLabel_5'>"+hospitalizationNote.out_hospital_date+"</td>"+
				              "      <td class='tdLabel_5' style='width:280px'><a class='btn' style='padding:6px 2px' target='_blank' href='${basePath}/statics/showMedrecordImage?firstGuid="+hospitalizationNote.first_level_medical_guid+"'>首页预览</a> <a class='btn' target='_blank' href='http://localhost:8888/medical-manage/medrecord/medrecordHomePageManage?firstGuid="+hospitalizationNote.first_level_medical_guid+"'>首页编辑</a></td>"+
				              "  </tr>";
					}
					
					$("#tbody").html(html);
					page(currentStartNum+1,totalCounts);
					
				}
	
			}
		})
		
	}
	
	 function page(currentPage,totalCounts){
	    	//var totalCounts = 1000;
	        var pageSize = 20;
	        var visiblePages = 10;
	        //var currentPage = 1;
	        /* var totalPages = totalCounts%pageSize==0?(totalCounts/pageSize):(totalCounts/pageSize+1); */
	        var totalPages = Math.ceil(totalCounts/pageSize);
	        $('#page_plus').jqPaginator({

	            totalCounts: totalCounts,
	            pageSize:pageSize,
	            visiblePages: visiblePages,
	            currentPage: currentPage,

	            first:'<li class="first"><a href="javascript:void(0);">首页</a></li>',
	            prev: '<li class="prev"><a href="javascript:void(0);">上一页</a></li>',
	            next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',
	            last: '<li class="last"><a href="javascript:void(0);">末页</a></li>',
	            page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
	            onPageChange: function (num,type) {
	          
	            	 if(type !='init'){
	                 
	            		 queryQua(num-1,pageSize);
	                 }
	            	
	                $("#totalPage").html(totalCounts);
	                $("#currentPage").html(num+"/"+totalPages);
	            }
	        });

	    }
	 
	
</script>

</body>
</html>